package cn.wxxyhw.server;

import cn.wxxyhw.Dao.UserDao;
import cn.wxxyhw.Entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * @Author: 洪稳
 * @Date: 2019/6/3
 */
@Service
public class Login {

    @Autowired
    private UserDao userDao;

    /**
     * 用户登陆处理
     * @param username 用户id
     * @param password 用户密码
     * @return boolean
     */
    public User login(String username, String password){
        User user = userDao.login(username, password);
        if (user!=null){
            user.setPassword(null); //处理敏感信息
        }
        return user;
    }
}
